import Layout from "@/pages/layout";
import Login from "@/pages/login"
import {createBrowserRouter}from 'react-router-dom'
import AuthRoute from "@/components/authroute";
import Home from "@/pages/layout/home";
import Publish from "@/pages/layout/publish";
import Manage from "@/pages/layout/manage";
import Update from "@/pages/layout/update";
const Router=createBrowserRouter([

    {
        path:'/',
        element:<AuthRoute><Layout/></AuthRoute>,
        // element:<Layout/>
        children:[
            {  
                // 添加一个默认的子路由，将默认路径设置为'/home'  
                default: true,  
                path:'',  
                element:<Home/>  
            },
            {
                path:'/home',
                element:<Home/>
            },
            {
                path:'/publish',
                element:<Publish/>
            },
            {
                path:'/manage',
                element:<Manage/>
            },
            {
                path:'/update',
                element:<Update/>
            },
        ]
    },
    {
        path:'/login',
        element:<Login/>
    }
]
)

export default Router